package cn.cau.epidemicsurveysystem.service.impl;

import cn.cau.epidemicsurveysystem.bean.QuestionAnsBean;
import cn.cau.epidemicsurveysystem.dao.QuestionAnsRepository;
import cn.cau.epidemicsurveysystem.service.QuestionAnsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @projectName: gp2023
 * @package: cn.cau.epidemicsurveysystem.service.impl
 * @className: QuestionAnsServiceImpl
 * @author: zy
 * @description: TODO
 * @date: 2022/3/4 9:19
 * @version: 1.0
 */

@Service
public class QuestionAnsServiceImpl implements QuestionAnsService {

    @Autowired
    QuestionAnsRepository ansRepository;

    @Override
    public QuestionAnsBean saveAns(QuestionAnsBean ans) {
        return ansRepository.save(ans);
    }

    @Override
    public List<QuestionAnsBean> findQuestionAnsBeansByMissionIdOrderByQuestionId(int missionId) {
        return ansRepository.findQuestionAnsBeansByMissionIdOrderByQuestionId(missionId);
    }
}